</div>

<script language="javascript">
    //帮助中心下拉
    $(function(){  
        var ma = jQuery('#list-help');
    	var mm = jQuery('.list-help-down');
    	ma.hover(function(){ mm.show(); ma.toggleClass('hover', true); },function(){ var menuhide = function(){ mm.hide(); ma.toggleClass('hover', false); }; menuout=setTimeout(menuhide,100); });
    	mm.hover(function(){ clearTimeout(menuout);},function(){ jQuery(this).hide(); ma.toggleClass('hover', false); }); 
    })
    
    //imglazyload图片缓冲
    $(function() {
        $("img.imglazyload").lazyload({     
        placeholder : "/static/img/lazyload.gif",
    	   effect : "fadeIn" 
        });  
    });
	
	//加入收藏
	function addfavor(url,title) {
		try {
			window.external.AddFavorite(url, title);
		} catch(e) {
		try {
			window.sidebar.addPanel(title, url, "");
		} catch(e) {
			alert("加入收藏失败，请使用Ctrl+D进行添加");
			}
		}
		return false;
	}
	
	//属于分类导航
	(function($){
	    var unfold = '收起',fold = '全部';
	    $('.selitem').each(function(){
	        var t = $(this);
	        var dd = t.find('dd');
	        var foldObj = t.find('span[class$=sql_fold]');
	        var shangquan = t.find('div[class$=shangquan]');
			var row = dd.attr('row');
	        if(dd.height() > 28*row)	
	        {
				dd.attr('class','fold'+row);
				var position = t.find('a[class$=select]').position()
				if((position && position.top>25*row) || shangquan.length > 0){
					dd.addClass('autoHeight');
					foldObj.attr('class','sql_unfold').text(unfold).show();
				}else{
					foldObj.attr('class','sql_fold').text(fold).show()
				};
	        }
	        foldObj.click(function(){
	            var tag = $(this).attr('class');
	            if(tag == 'sql_fold'){
	                dd.addClass('autoHeight');
	                foldObj.attr('class','sql_unfold').text(unfold).show();
	                }else{
	                dd.removeClass('autoHeight');
	                foldObj.attr('class','sql_fold').text(fold).show();
	            }
	            return false;
	        })
	    })
	})(jQuery);
	
	//头部搜索框
	$().ready(function(){
		$('#searchW').focus(function(){
			var value = $.trim($('#searchW').val());
			if(value == "请输入商品名称")
			{
				$('#searchW').val("");
			}
			this.parentNode.className='hover';

		});
		$('#searchW').blur(function(){
			var value = $.trim($('#searchW').val());
			if(value == "")
			{
				this.parentNode.className='';
				$('#searchW').val("请输入商品名称");
			}

		});
		$("#indexSearchForm").submit( function () {
			var value = $.trim($('#searchW').val());
			if(value == "" || value == "请输入商品名称")
			return false;
			else{
				var reg = /[`|~|!|…|！|￥|@|#|$|%|^|*|\(|\)|（|）|、|{|}|\[|\]|:|\"|：|"|"|'|'|；|，|。|？|《|》|、|,|.|<|>|\?\|\/]/;
				var regvalue = value
				for(i=0;i<value.length;i++)
				{
					regvalue =  regvalue.replace(reg, "");
				}
				value = regvalue;
				$("#indexSearchForm").attr("action","?keyword=" + value);
			}
		} );

	});
	
	$(document).ready(function(){ //按钮变色
		$(".t-cen").hover(function(){ $(this).addClass('hover'); $('#uc ul').show();},
		function(){$('#uc ul').hide();$(this).removeClass('hover');});
	});
</script>
</body>
</html>
